
#ifndef SoundEffectInstance_h
#define SoundEffectInstance_h

#include <System/Array.h>

#include <System/IDisposable.h>

#include "SoundState.h"
#include "AudioChannels.h"

namespace Riccsson
{
	namespace Xna
	{
		namespace Framework
		{
			namespace Audio
			{
				// Not implemented.
				class AudioListener;
				class AudioEmitter;

				// Summary:
				//     Provides properties, methods, and events for play back of the audio buffer.
				class SoundEffectInstance : public Riccsson::System::Object, public Riccsson::System::IDisposable
				{
				public:
					virtual void onBufferNeeded();

				protected:
					void init(int sampleRate, AudioChannels channels);

					PROP3GET(SoundEffectInstance, bool, IsDisposed)
					PROP3(SoundEffectInstance, bool, IsLooped)
					PROP3(SoundEffectInstance, float, Pan)
					PROP3(SoundEffectInstance, float, Pitch)
					PROP3GET(SoundEffectInstance, SoundState, State)
					PROP3(SoundEffectInstance, float, Volume)
					
					COPY_CONSTRUCTOR(SoundEffectInstance)
					{
						PROP3GET_INIT_COPY(SoundEffectInstance, bool, IsDisposed);
						PROP3_INIT_COPY(SoundEffectInstance, bool, IsLooped);
						PROP3_INIT_COPY(SoundEffectInstance, float, Pan);
						PROP3_INIT_COPY(SoundEffectInstance, float, Pitch);
						PROP3GET_INIT_COPY(SoundEffectInstance, SoundState, State);
						PROP3_INIT_COPY(SoundEffectInstance, float, Volume);
					}

					// Summary:
					//     Gets a value that indicates whether the object is disposed.
					public: PROP3_GET(bool, IsDisposed)
					{
						throw;
					}

					//
					// Summary:
					//     Gets a value that indicates whether looping is enabled for the SoundEffectInstance.
					//     Reference page contains links to related code samples.
					public: virtual PROP3_GET(bool, IsLooped)
					{
						throw;
					}
					public: virtual PROP3_SET(bool, IsLooped)
					{
						throw;
					}

					//
					// Summary:
					//     Gets or sets the panning for the SoundEffectInstance.
					//public: float Pan { get; set; }
					public: PROP3_GET(float, Pan)
					{
						throw;
					}
					public: PROP3_SET(float, Pan)
					{
						throw;
					}

					//
					// Summary:
					//     Gets or sets the pitch adjustment for the SoundEffectInstance. Reference
					//     page contains links to related code samples.
					//public: float Pitch { get; set; }
					public: PROP3_GET(float, Pitch)
					{
						throw;
					}
					public: PROP3_SET(float, Pitch)
					{
						throw;
					}

					//
					// Summary:
					//     Gets the current state (playing, paused, or stopped) of the SoundEffectInstance.
					//public: SoundState State { get; }
					public: PROP3_GET(SoundState, State)
					{
						throw;
					}

					//
					// Summary:
					//     Gets or sets the volume of the SoundEffectInstance. Reference page contains
					//     links to related code samples.
					//public: float Volume { get; set; }
					public: PROP3_GET(float, Volume)
					{
						throw;
					}
					public: PROP3_SET(float, Volume)
					{
						throw;
					}

					public: SoundEffectInstance();

					// Summary:
					//     Applies 3D positioning to the sound using a single listener. Reference page
					//     contains links to related code samples.
					//
					// Parameters:
					//   listener:
					//     Position of the listener.
					//
					//   emitter:
					//     Position of the emitter.
					public: void Apply3D(AudioListener* listener, AudioEmitter* emitter);
					//
					// Summary:
					//     Applies 3D position to the sound using multiple listeners. Reference page
					//     contains links to related code samples.
					//
					// Parameters:
					//   listeners:
					//     Positions of each listener.
					//
					//   emitter:
					//     Position of the emitter.
					public: void Apply3D(Riccsson::System::Array<AudioListener>* listeners, AudioEmitter* emitter);
					//
					// Summary:
					//     Releases unmanaged resources held by this SoundEffectInstance.
					public: void Dispose();
					//
					// Summary:
					//     Releases the unmanaged resources held by this SoundEffectInstance, and optionally
					//     releases the managed resources.
					//
					// Parameters:
					//   disposing:
					//     Pass true to release both the managed and unmanaged resources for this SoundEffectInstance.
					//     Passing false releases only the unmanaged resources.
					protected: virtual void Dispose(bool disposing);
					//
					// Summary:
					//     Pauses a SoundEffectInstance.
					public: void Pause();
					//
					// Summary:
					//     Plays or resumes a SoundEffectInstance.
					public: virtual void Play();
					//
					// Summary:
					//     Resumes playback for a SoundEffectInstance.
					public: void Resume();
					//
					// Summary:
					//     Immediately stops playing a SoundEffectInstance.
					public: void Stop();
					//
					// Summary:
					//     Stops playing a SoundEffectInstance, either immediately or as authored.
					//
					// Parameters:
					//   immediate:
					//     Whether to stop playing immediately, or to break out of the loop region and
					//     play the release. Specify true to stop playing immediately, or false to break
					//     out of the loop region and play the release phase (the remainder of the sound).
					public: void Stop(bool immediate);
				};
			}
		}
	}
}

#endif